-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typed search attributes #1612
Typed search attributes #1612
Conversation
Most of the necessary revisions are done, fixing failing tests and adding new ones. |
- remove ITypedSearchAttributes, expose concrete class TypedSearchAttributes - update constructor to take a list of pairs, consistent with the usage of pairs and class throughout the API - `Options` objects (i.e. user input) allow for both pairs and the concrete class as input types - created `TypedSearchAttributeUpdate`/`Pair` types, to be used for upserts and updates, the only difference with these types and the existing `TypedSearchAttribute/Pair` types is that they except `null` values (for deletion) - fixed the `upsert` method to accomodate these types - `updateSearchAttributes` now returns a new copy of `TypedSearchAttributes` to avoid mutation of existing `TypedSearchAttributes` objects - a myriad of small changes to accomodate the type changes
e6c6b31
to
af0754e
Compare
Updated the PR description with an overview for reviewers. Some remaining points of uncertainty:
|
9d727b3
to
3877147
Compare
3877147
to
3261083
Compare
Who do I need to get in touch with to update docs? (considering we're deprecating a user-facing feature in exchange for another) |
…tic methods within the class renamed some types and methods
1a601a1
to
0c3afe2
Compare
We now have many linter warnings about usage of deprecated APIs. You will need to silence all of them by appending a |
There were a lot, I suppressed them inline, but is there a reason we don't do this in the eslint config instead? |
The "deprecation" rule plugin that we are using at the moment unfortunately doesn't have any level of configurability. And we really want to check for usage of deprecations, e.g. us using deprecated Node.js or third party libraries APIs. |
packages/test/package.json
Outdated
@@ -8,7 +8,11 @@ | |||
"build:ts": "tsc --build", | |||
"build:protos": "node ./scripts/compile-proto.js", | |||
"test": "ava ./lib/test-*.js", | |||
"test.watch": "ava --watch ./lib/test-*.js" | |||
"test.watch": "ava --watch ./lib/test-*.js", | |||
"test-split-one": "ava ./lib/test-integration-split-one.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly useful while developing locally, but I don't think we should commit such aliases. Too specic/volatile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, mistakenly commit - thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one last comment. Feel free to merge after that.
496ffd9
to
5b75abd
Compare
What was changed
Introduces
TypedSearchAttributes
to the Typescript SDK, allowing users to supply and receive type-enforced search attributes.TypedSearchAttributes
are intended to replace the existing (not type-enforced)SearchAttributes
which have been marked as@deprecated
in its existing usages.Why?
Brings parity with other SDKs which have a typed search attribute implementation.
Brings parity to how the server represents search attributes.
Provides a typed, structured interface to use search attributes.
For reviewers
Points of interest:
typed-search-attributes.ts
contains the APItest-typed-search-attributes.ts
contains tests and demonstrates API usageworflow.ts
for changes toupsertSearchAttributes
(mutations to search attributes in workflow info)payload-search-attributes.ts
contains decoding/encoding logic for search attributes (both legacy and typed)Closes [Feature Request] Typed Search Attributes #1232
How was this tested:
Added tests, see
test-typed-search-attributes.ts
Any docs updates needed?
Likely as we are deprecating existing
SearchAttributes